#include <iostream>
#include <cstdio>

#define N 40
#define M 40

using namespace std; 

int a[M][N]; 
int n, m; 

int main()
{
	int j, i, x, y; 
	
	cin>>n>>m; 

	a[0][0] = 1; 	
	for (j=1; j<=m; j++) {
		for (i=0; i<n; i++) {
			x = (i==n-1) ? 0 : i+1; 
			y = (i==0 ? n-1 : i-1); 
			a[j][i] = a[j-1][y] + a[j-1][x]; 
//			printf("j=%d, i=%d, x=%d, y=%d, a[j][i]=%d, a[j-1][x]=%d, a[j-1][y]=%d\n", j, i, x, y, a[j][i], a[j-1][x], a[j-1][y]); 
		}
	}
	printf("%d\n", a[m][0]); 
	return 0; 
}



